import request from "@/utils/request.js"

// 获取合同列表
export function getAgreementListApi(data){
	return request({
		url: '/crm/contract/page',
		method: 'GET',
		params: data
		
	})
}
// 创建合同
export function createAgreementApi(data){
	return request({
		url: '/crm/contract/create',
		method: 'POST',
		data: data
	})
}
// 合同详情
export function getContractDetailApi(id){
	return request({
		url: `/crm/contract/get?id=${id}`,
		method: 'GET'
	})
}
// 编辑合同
export function updateContractApi(data){
	return request({
		url: '/crm/contract/update',
		method: 'PUT',
		data: data
	})
}
// 删除合同
export function deleteContractApi(id){
	return request({
		url: `/crm/contract/delete?id=${id}`,
		method: 'DELETE'
	})
}
// 作废合同
export function cancelContractApi(data){
	return request({
		url: '/crm/contract/invalidate/apply',
		method: 'PUT',
		data: data
	})
}
